﻿function loading() {
    layer.open({ type: 2, time: 10, shadeClose: true });
}
function loading2() {
    layer.open({ type: 2, shadeClose: false });
}
function txttip(txt, endfun) {
    layer.open({ content: txt, skin: 'msg', time: endfun != undefined ? 1 : 3, end: endfun });
}
function reload_page() {
    location.href = location.href;
}
function isPositiveInteger(s) {
    var re = /^[0-9]+$/;
    return re.test(s)
}
function isNumber(val) {
    var re = /^[0-9]+.?[0-9]*/;
    if (!re.test(val)) { 
        return false;
    } 
    return true;
}
function out() {
    layer.closeAll();
    txttip('您已退出登录，请重新登录', function () { location.href = '/Home?t=weixin'; });
}
function isimg(ext) {
    if (ext == 'jpg' || ext == 'gif' || ext == 'jpeg' || ext == 'bmp' || ext == 'png') {
        return true;
    }
    return false;
}
function query() {

    var url = '/index/index/query?key=' + $('#kw').val()+'&owner='+$('#owner').val();
    location.href = url;
}
function is_weixn() {
    var ua = navigator.userAgent.toLowerCase();
    if (ua.match(/MicroMessenger/i) == "micromessenger") {
        return true;
    } else {
        return false;
    }
}
$(function () {
    if (!is_weixn()) {
        //location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=1&redirect_uri=&response_type=code&scope=snsapi_userinfo&state=&connect_redirect=1#wechat_redirect';
    }
});